from socket import *

# serverSocket只做监听连接而不发送数据给客户端
serverSocket = socket(AF_INET, SOCK_STREAM)
serverSocket.bind(("", 8899))
serverSocket.listen(5)

print("====1====")
# clientSocket表示新的客户端socket对象，clientInfo表示新的客户端的ip和端口信息
# clientSocket负责发送数据和接收客户端数据
clientSocket, clientInfo = serverSocket.accept()
print("====2====")

# 接收数据
recvData = clientSocket.recv(1024)
# clientSocket.send("thank you")
print("====3====")

print("%s:%s" % (str(clientInfo), recvData))

clientSocket.close()
serverSocket.close()
